# CMakeList.txt: gitstore 的 CMake 项目，在此处包括源代码并定义
# 项目特定的逻辑。
#
cmake_minimum_required (VERSION 3.8)
#set(CMAKE_CXX_STANDARD 17)
#project(GitStoreGrpcService)
#set(CMAKE_BUILD_TYPE "Debug")
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -Wall -g2 -ggdb -ldl -pthread")
#set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -Wall -g2 -ggdb -ldl -pthread")
#add_definitions(-D _FILE_OFFSET_BITS=64)
#find_package(gRPC)
#include_directories("/usr/include")
#link_directories("/usr/lib" "/usr/local/lib" "/usr/lib/x86_64-linux-gnu")
find_package(gRPC REQUIRED)
# 将源代码添加到此项目的可执行文件。
add_library(GitStoreGrpcLib SHARED "service.pb.cc" "service.pb.h" "service.grpc.pb.h" "service.grpc.pb.cc")
if(gRPC_FOUND)
    message("grpc found!")
#    target_include_directories(GitStoreGrpcLib PRIVATE ${gRPC_INCLUDE_DIR})
    target_link_libraries(GitStoreGrpcLib gRPC::gpr gRPC::grpc gRPC::grpc++ gRPC::grpc++_reflection)
else()
    message(FATAL_ERROR "grpc lib not found!")
#    target_link_libraries(GitStoreGrpcLib grpc++ grpc grpc++_reflection cares ssl /usr/local/lib/libprotobuf.so address_sorting /usr/local/lib/libgpr.so)
endif()
# TODO: 如有需要，请添加测试并安装目标。
